﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Liger.Web.Common;
using Liger.Web.Common.Extensions;

namespace Liger.Web.UI
{
    public class TipBuilder : UIComponentBuilderBase, IHideObjectMembers
    {
        private Tip Tip
        {
            get
            {
                return this.Component as Tip;
            }
        }


        public TipBuilder()
            : base(new Tip())
        {

        }

        public TipBuilder(Tip Tip)
            : base(Tip)
        {

        }

        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public TipBuilder Set(string property, object value)
        {
            if (this.Tip.Properties.ContainsKey(property))
            {
                this.Tip.Properties[property] = value;
            }
            else
            {
                this.Tip.Properties.Add(property, value);
            }
            return this;
        }

        /// <summary>
        /// 返回ligerTip的Manager
        /// </summary>
        /// <param name="manager">manager的对象名</param>
        /// <returns></returns>
        public TipBuilder Manager(string manager)
        {
            this.Tip.Manager = manager;
            return this;
        }


        public TipBuilder Content(string value)
        {
            this.Tip.Content = value;
            return this;
        }
        public TipBuilder Callback(string value)
        {
            this.Tip.Callback = value;
            return this;
        }
        public TipBuilder Width(int value)
        {
            this.Tip.Width = value;
            return this;
        }
        public TipBuilder Height(string value)
        {
            this.Tip.Height = value;
            return this;
        }
        public TipBuilder X(int value)
        {
            this.Tip.X = value;
            return this;
        }
        public TipBuilder Y(int value)
        {
            this.Tip.Y = value;
            return this;
        }
        public TipBuilder AppendIdTo(string value)
        {
            this.Tip.AppendIdTo = value;
            return this;
        }
        public TipBuilder Target(string value)
        {
            this.Tip.Target = value;
            return this;
        }
        public TipBuilder Auto(string value)
        {
            this.Tip.Auto = value;
            return this;
        }
        public TipBuilder RemoveTitle(bool value)
        {
            this.Tip.RemoveTitle = value;
            return this;
        }
    }
}